<?php
/*! \brief
 * This is extension class WFDataObject for Mysql
 * \author William Su
 */
require_once dirname(__FILE__).'/DatabaseObject.interface.php';
require_once dirname(__FILE__).'/DatabaseObject.php';
class WFDatabaseObjectMysql extends  WFDatabaseObject implements IDatabaseObject
{
    /**
     *\brief Description
     * Check is specific table existed?
     * If existed return true, if not existed return false.
     * @param string $strTableName table name
     * @return bool
     */
    public function isTableExists($strTableName){
        $sql="SHOW TABLES LIKE '".$strTableName."'";
        $sth = $this->dbh->prepare($sql);
        $sth->execute();
        $result = $sth->fetch(PDO::FETCH_NUM);
        
		return isset($result[0]) && $result[0] == $strTableName ? true : false;
    }
}